#workspace
library(tidyverse) #1.3.1

#data
d = read.table("/m/triton/scratch/work/malkama5/politicisationScience/lulucf.txt", header = TRUE, sep = ";")
names(d)[c(2, 3, 5, 9)] = c("Forest land", "Wood Products", "Agricultural land", "Other land")
b = reshape2::melt(d[c(1, 2, 3, 9)], id = "Year")
l = reshape2::melt(d[c(1, 4)], id = "Year")

p = ggplot() +
geom_bar(data = b, aes(x = factor(Year), y = value, fill = factor(variable, levels = c("Wood Products", "Other land", "Forest land"))), position = "stack", stat = "identity") +
scale_fill_manual(values = c("#F4B400", "#0F9D58", "#4285F4")) +
geom_point(data = l, aes(x = factor(Year), y = value), color = "#ffffff", size = 0.5) +
theme(legend.title = element_blank(), legend.key = element_rect(fill = NA), axis.ticks = element_blank(), panel.grid.major = element_blank(), panel.grid.minor = element_blank(), panel.border = element_blank(), panel.background = element_blank(), text = element_text(family = "Times", color = "black"), axis.text.x = element_text(size = 8, color = "black", angle = 45, vjust = 1, hjust = 1), axis.text.y = element_text(size = 8, color = "black")) +
labs(title = NULL, x = NULL, y = "MMTCDE")
ggsave(plot = p, filename = "/m/triton/scratch/work/malkama5/politicisationScience/lulucf.png", width = 8, height = 3, dpi = 1000)
